const mongoose = require('mongoose');
const ObjectId = require('mongodb').ObjectID;
const mongoose_paginate = require('mongoose-paginate');

/**
 * 此模型，为记录模型， _id 实际上就是 click_id
 * is_sub 判断是否已订阅, 0为未订阅, 1位订阅
 */
const RecordSchema = new mongoose.Schema({
    operator_code: String,
    task_id: String,
    error_log: String,
    run_log: String,
    is_sub: Number,
    created_time: {type: Date, default: Date.now}
});

RecordSchema.plugin(mongoose_paginate);

module.exports = mongoose.model("Record", RecordSchema, "record");
